home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 1 / PC Actual CD 01.iso / share / dos / progr / vga.doc / text0000.txt < prev   
Encoding:
Text File  |  1993-02-19  |  23.4 KB  |  518 lines

  1. OK...here it comes....
  2.  
  3.  
  4. Documentation over the I/O registers for standard VGA-cards
  5.  
  6. Documentated by Shaggy of The Yellow One.
  7.  
  8. Email: D91-SJD@TEKN.HJ.SE
  9.  
  10. Feel free to spread this to who ever wants it.....
  11. ------------------------------------------------------------
  12. Port-Index:  -               Port: Write/03c2h Read/03cch
  13. usage:       d7   Vertical sync polarity
  14.              d6   Horizontal sunc polarity
  15.              d5   Odd /even page
  16.              d4   Disable video
  17.              d3   Clock select 1
  18.              d2   Clock select 0
  19.              d1   Enable/Disable display RAM
  20.              d0   I/O address select
  21. Description: Sync polarity: Bits are set as below for VGA displays
  22.              that use sync polarity to determine screen resolution.
  23.              Many newer multiple frequency displays are insensitive
  24.              to sync polarity
  25.  
  26.              d7 d6      Resolution
  27.              0  0       Invalid
  28.              0  1       400 lines
  29.              1  0       350 lines
  30.              1  1       480 lines
  31.  
  32.              I/o address select: When set to zero, selects the
  33.              monochrome I/O address space (3bx). When set to one,
  34.              it selects the color I/O address space (3dx)
  35.  
  36. ------------------------------------------------------------
  37. Port-Index: -                Port: 03c2h ; read only
  38. usage:      d7    Vertical Retrace Interrupt pendling
  39.             d6    Feature connector bit 1
  40.             d5    Feature connector bit 0
  41.             d4    Switch sense
  42.             d0-d3 Unused
  43.  
  44. Description: d7 uses IRQ2
  45.  
  46. ------------------------------------------------------------
  47. Port-Index: -                Port: 03bah,03dah ; read only
  48. usage:      d3  Vertical retrace
  49.             d0  Horizontal retrace
  50.  
  51. ------------------------------------------------------------
  52. Port-Index: -                Port: 03c3h,46e8h
  53. usage:      d7-d1  Reserved
  54.             d0     VGA enable/disable (03c3h only)
  55.  
  56. Description: Disables access to display memmory and the other
  57.              VGA's ports
  58.  
  59. ------------------------------------------------------------
  60. Port-Index: 00h              Port: 03d4h, 03b4h
  61. usage:      Horizontal total
  62. Description: Total number of characters in horizontal scan minus
  63.              five ( including blanked and border characters)
  64.  
  65. ------------------------------------------------------------
  66. Port-Index: 01h              Port: 03d4h, 03b4h
  67. usage:      Horizontal display enable
  68. Description: Total number of characters displayed in horizontal
  69.              scan minus one.
  70. ------------------------------------------------------------
  71. Port-Index: 02h              Port: 03d4h, 03b4h
  72. usage:      Start horizontal blanking
  73. Description: Character at which blanking starts
  74.  
  75. ------------------------------------------------------------
  76. Port-Index: 03h              Port: 03d4h, 03b4h
  77. usage:      End horizontal blanking
  78.             d7    Test
  79.             d6    Skew control
  80.             d5    Skew control
  81.             d0-d4 End blanking
  82. Description: End blanking: is five LSB bits of six-bit value,
  83.              which define the character at which blanking stops.
  84.              The MSB bit of this value is in register index 5.
  85.  
  86. ------------------------------------------------------------
  87. Port-Index: 04h              Port: 03d4h, 03b4h
  88. usage:      Start horizontal retrace
  89. Description: Character at which horizontal retrace starts
  90.  
  91. ------------------------------------------------------------
  92. Port-Index: 05h              Port: 03d4h, 03b4h
  93. usage:      End horizontal retrace
  94.             d7    End horizontal blanking bit 5
  95.             d6    Horizontal retrace delay
  96.             d5    Horizontal retrace delay
  97.             d0-d4 End horizontal retrace
  98. Description: End horizontal retrace: defines the character at
  99.              which horizontal retrace ends
  100.  
  101. ------------------------------------------------------------
  102. Port-Index: 06h              Port: 03d4h, 03b4h
  103. usage:      Vertical total
  104. Description: Total number of horizontal scan lines minus two
  105.              (including blanked and border characters). MSB bits
  106.              of this value are in register index 7
  107.  
  108. ------------------------------------------------------------
  109. Port-Index: 07h              Port: 03d4h, 03b4h
  110. usage:      Overflow register
  111.             d7  Vertical retrace start (bit 9)
  112.             d6  Vertical display enable end (bit 9)
  113.             d5  Vertical total (bit 9)
  114.             d4  Line compare (bit 8)
  115.             d3  Start vertical blank (bit 8)
  116.             d2  Vertical retrace start (bit 8)
  117.             d1  Vertical display enable end (bit 8)
  118.             d0  Vertical total (bit 8)
  119. ------------------------------------------------------------
  120. Port-Index: 08h              Port: 03d4h, 03b4h
  121. usage:      Preset row scan
  122.             d7    Unused
  123.             d6    Byte panning control
  124.             d5    Byte panning control
  125.             d0-d4 Preset row scan
  126. Description: Byte panning control: is used to control byte
  127.              panning. This register together with attribute
  128.              controller register 13h allows for up to 31 pixels of
  129.              panning in double word modes
  130.              Preset row scan: Which character scan line is the
  131.              first to be displayed
  132. ------------------------------------------------------------
  133. Port-Index: 09h              Port: 03d4h, 03b4h
  134. usage:      Maximum scan line/Character height
  135.             d7    double scan
  136.             d6    bit d9 of line compare register
  137.             d5    bit d9 of start vertical blank register
  138.             d0-d4 Maximum scan line
  139. Description: d0-d5=Character height-1,  only in textmodes
  140. ------------------------------------------------------------
  141. Port-Index: 0ah              Port: 03d4h, 03b4h
  142. usage:      Cursor start
  143.             d7,d6 Reserved (0)
  144.             d5    Cursor off
  145.             d4-d0 Cursor start
  146. Description:
  147. ------------------------------------------------------------
  148. Port-Index: 0bh              Port: 03d4h, 03b4h
  149. usage:      Cursor end
  150.             d7    reserved
  151.             d6,d5 Cursor skew
  152.             d4-d0 Cursor end
  153. Description:
  154. ------------------------------------------------------------
  155. Port-Index: 0ch              Port: 03d4h, 03b4h
  156. usage:      Start address high
  157. ------------------------------------------------------------
  158. Port-Index: 0dh              Port: 03d4h, 03b4h
  159. usage:      Start address low
  160. Description: Determine the offset in display memory to be
  161.              displayed on the upper-left corner on the screen
  162. ------------------------------------------------------------
  163. Port-Index: 0eh              Port: 03d4h, 03b4h
  164. usage:      Cursor location (high byte)
  165. ------------------------------------------------------------
  166. Port-Index: 0fh              Port: 03d4h, 03b4h
  167. usage:      Cursor location (low byte)
  168. Description: Where the cursor is displayed on screen
  169. ------------------------------------------------------------
  170. Port-Index: 10h              Port: 03d4h, 03b4h
  171. usage:      Vertical retrace start
  172. Description: 8 bits out of 10
  173. ------------------------------------------------------------
  174. Port-Index: 11h              Port: 03d4h, 03b4h
  175. usage:      Vertical retrace end
  176.             d7    Write protect CRTC register 0 to 7
  177.             d6    refresh cycle select
  178.             d5    enable vertical interrupt (when 0)
  179.             d4    Clear vertical interrupt (when 0)
  180.             d0-d3 Vertical retrace end
  181. ------------------------------------------------------------
  182. Port-Index: 12h              Port: 03d4h, 03b4h
  183. usage:      Vertical display enable end
  184. Description: eight LSB bits out of ten-bit value which define
  185.              scan line minus one at which the display ends.
  186.              The other two are in CRTC register index 7
  187. ------------------------------------------------------------
  188. Port-Index: 13h              Port: 03d4h, 03b4h
  189. usage:      Offset / Logical screen width
  190. Description: Logical screen width between successive scan lines
  191. ------------------------------------------------------------
  192. Port-Index: 14h              Port: 03d4h, 03b4h
  193. usage:      Underline location register
  194.             d7    Reserved
  195.             d6    Double word mode
  196.             d5    count by 4
  197.             d0-d4 Underline location
  198. Description: Underline location: Monochrome textmode only
  199. ------------------------------------------------------------
  200. Port-Index: 15h              Port: 03d4h, 03b4h
  201. usage:      Start vertical blanking
  202. Description: eight LSB bits of ten-bit value minus one which
  203.              define at which scan line the vertical blanking
  204.              starts. The other two bits are in CRTC registers
  205.              index 7 and 9
  206. ------------------------------------------------------------
  207. Port-Index: 16h              Port: 03d4h, 03b4h
  208. usage:      End vertical blanking
  209. Description: eight LSB bits of a value which determine the scan
  210.              line after which vertical blanking ends.
  211. ------------------------------------------------------------
  212. Port-Index: 17h              Port: 03d4h, 03b4h
  213. usage:      Mode control register
  214.             d7  Enable vertical and hoizontal retrace
  215.             d6  Byte mode (1), word mode (0)
  216.             d5  Address wrap
  217.             d4  Reserved
  218.             d3  count by 2
  219.             d2  multiple vertical by 2 (use half in
  220.                 CRTC (8,10,12,14,18)
  221.             d1  Select row scan counter (not used)
  222.             d0  compatibilty mode support (enable interleave)
  223. ------------------------------------------------------------
  224. Port-Index: 18h              Port: 03d4h, 03b4h
  225. usage:      Line compare register
  226. Description: Split screen,  8 bit value out of a ten-bit value
  227. ------------------------------------------------------------
  228. Port-Index: 00h              Port: 03c4h
  229. usage:      Reset register
  230.             d7-d2 Reserved
  231.             d1    Synchronous reset
  232.             d0    Asynchronous reset
  233. Description: Synchr. when set to zero, will halt and reset
  234.              the sequencer at the end of its current cycle
  235.              Asyncht. when set to zero, will immediatly halt
  236.              and reset the sequencer. Data can be loss.
  237. ------------------------------------------------------------
  238. Port-Index: 01h              Port: 03c4h
  239. usage:      Clock mode register
  240.             d7,d6 Reserved
  241.             d5    display off
  242.             d4    Allow 32-bit Fetch (not used in standard modes)
  243.             d3    Divide dot clock by 2 (used in some 320*200 modes)
  244.             d2    Allow 16-bit fetch (used in mon graphics modes)
  245.             d1    Reserved
  246.             d0    Enable (0) 9 dot characters (mono text and 400-line)
  247. Description: Display off: Will blank screen and give the cpu
  248.              uninterrupted access the display memory.
  249. ------------------------------------------------------------
  250. Port-Index: 02h              Port: 03c4h
  251. usage:      Color plane write enable register
  252.             d7,d6 Reserved
  253.             d3    Plane 3 Write enable
  254.             d2    Plane 2 Write enable
  255.             d1    Plane 1 Write enable
  256.             d0    Plane 0 Write enable
  257. Description:
  258. ------------------------------------------------------------
  259. Port-Index: 03h              Port: 03c4h
  260. usage:      Character generator select register
  261.             d7,d6 Reserved
  262.             d5    Character generator table select A (MSB)
  263.             d4    Character generator table select B (MSB)
  264.             d3,d2 Character generator table select A
  265.             d1,d0 Character generator table select B
  266. Description: This register is only of interest if your software
  267.              will be using multiple character sets. Either one
  268.              or two character sets can be active. Table A selects
  269.              the charcater with attribute d3 set to zero and
  270.              Table B is the one with d3 set to one.
  271. ------------------------------------------------------------
  272. Port-Index: 04h              Port: 03c4h
  273. usage:      Memory mode register
  274.             d4-d7 Reserved
  275.             d3    Chain 4 (address bits 0&1 to select plan, mode 13h)
  276.             d2    Odd/even (address bit 0 to select plane 0&2 or   
  277.                   1&3 text modes)
  278.             d1    Extended memory (disable 64k modes)
  279.             d0    Reserved
  280. Description:
  281. ------------------------------------------------------------
  282. Port-Index: 00h              Port: 03ceh
  283. usage:      Set / Reset register
  284.             d7-d4 Reserved (0)
  285.             d3    Fill data for plane 3
  286.             d2    Fill data for plane 2
  287.             d1    Fill data for plane 1
  288.             d0    Fill data for plane 0
  289. ------------------------------------------------------------
  290. Port-Index: 01h              Port: 03ceh
  291. usage:      Set / Reset enable register
  292.             d7-d4 Reserved (0)
  293.             d3    enable set/reset for plane 3 (1 = enable)
  294.             d2    enable set/reset for plane 2 (1 = enable)
  295.             d1    enable set/reset for plane 1 (1 = enable)
  296.             d0    enable set/reset for plane 0 (1 = enable)
  297. Description: Set/Reset enable defines which memory planes will
  298.              receive fill data from set/reset register. Any plane
  299.              that is disable for set/reset will be written with
  300.              normal processor output data
  301. ------------------------------------------------------------
  302. Port-Index: 02h              Port: 03ceh
  303. usage:      Color compare register
  304.             d7-d4 Reserved
  305.             d3    Color compare value for plane 3
  306.             d2    Color compare value for plane 2
  307.             d1    Color compare value for plane 1
  308.             d0    Color compare value for plane 0
  309. Description: one indicate that color is the same
  310. ------------------------------------------------------------
  311. Port-Index: 03h              Port: 03ceh
  312. usage:      Data rotate / Function select register
  313.             d7-d5 Resrved (0)
  314.             d4,d3 Function select
  315.             d2-d0 Rotate count
  316.  
  317.             d4 d3  Function
  318.             0  0   Write data unmodified
  319.             0  1   Write data ANDed with processor latches
  320.             1  0   Write data ORed with processor latches
  321.             1  1   Write data XORed with processor latches
  322. Description: Rotation is made before writing data
  323. ------------------------------------------------------------
  324. Port-Index: 04h              Port: 03ceh
  325. usage:      Read plane select register
  326.             d7-d2 Reserved (0)
  327.             d1,d0 Defines color plane for reading (0-3)
  328. Description: Doesnt matter in color compare mode
  329. ------------------------------------------------------------
  330. Port-Index: 05h              Port: 03ceh
  331. usage:      Mode register
  332.             d7    Reserved (0)
  333.             d6    256-colour mode
  334.             d5    Shift register mode
  335.             d4    Odd / Even mode
  336.             d3    Color compare mode enable (1 = enable)
  337.             d2    Reserved (0)
  338.             d1,d0 Write mode
  339.  
  340.             d1 d0 Write mode
  341.             0  0  Direct write (data rotate, set/reset may apply)
  342.             0  1  Use processor latches as write data
  343.             1  0  Color plane n (0-3) is filled with the value of
  344.                   bit n in the write data
  345.             1  1  Use (rotated) write data ANDed with Bit mask as
  346.                   bit mask. Use set/reset as if set/reset was
  347.                   enable for all planes
  348. Description:
  349. ------------------------------------------------------------
  350. Port-Index: 06h              Port: 03ceh
  351. usage:      Miscellaneous register
  352.             d7-d4 Reserved
  353.             d3-d2 Memory map
  354.                   00 = A000h for 128k
  355.                   01 = A000h for 64k
  356.                   10 = B000h for 32k
  357.                   11 = B800h for 32k
  358.             d1    Odd/even enable (used in text modes)
  359.             d0    Graphics mode enable
  360. Description: Memory map defines the location and size of the
  361.              host window
  362. ------------------------------------------------------------
  363. Port-Index: 07h              Port: 03ceh
  364. usage:      Color don't care register
  365.             d7-d4 Reserved (0)
  366.             d3    Plane 3 don't care
  367.             d2    Plane 2 don't care
  368.             d1    Plane 1 don't care
  369.             d0    Plane 0 don't care
  370. Description: Color don't care is used in conjunction with color
  371.              compare mode. This register masks particular planes
  372.              from being tested during color compare cycles.
  373. ------------------------------------------------------------
  374. Port-Index: 08h              Port: 03ceh
  375. usage:      Bitmask register
  376. Description: The bitmask register is used to mask certain bit
  377.              positons from being modified.
  378. ------------------------------------------------------------
  379. Port-Index: -                 Port: 03c0h both index and data
  380. usage:      d7,d6 Reserved
  381.             d5    Palette address source
  382.                   0 = palette can be modified, screen is blanked
  383.                   1 = screen is enable, palette cannot be modified
  384.             d4-d0 Palette register address
  385. Description: Palette register address selects which register of
  386.              the attributes controller will be addres,sed by the
  387.              next I/O write cycle
  388. ------------------------------------------------------------
  389. Port-Index: 00h-0fh          Port: 03c0h
  390. usage:      Color palette register
  391.             d6,d7 Reserved
  392.             d5-d0 Color value
  393. Description: not used in 256 color modes
  394. ------------------------------------------------------------
  395. Port-Index: 10h              Port: 03c0h
  396. usage:      Mode control register
  397.             d7  p4,p5 source select
  398.             d6  pixel width
  399.             d5  Horizontal panning compatibility
  400.             d4  Reserved
  401.             d3  Background intensify / enable blinking
  402.             d2  Line graphics enable (text modes only)
  403.             d1  display type
  404.             d0  graphics / text mode
  405. Description: p4,p5 source select: selects the source for video
  406.               outputs p4 and p5 to the DACs. If set to zero, p4
  407.               and p5 are driven from the palette registers (normal
  408.               operation). If set to one, p4 and p5 video outputs
  409.               come from bits 0 and 1 of the color select register.
  410.              pixel width: is set to one in mode 13h (256-color mode)
  411.              horizontal panning compatibility: enhances the
  412.               operation of the line compare register of the CRT
  413.               controller, which allows one section of the screen
  414.               to be scrolled while another section remains stationary.
  415.               When this bit is set to one, the stationary
  416.               section of the screen will also be immune to horizontal
  417.               panning.
  418. ------------------------------------------------------------
  419. Port-Index: 11h              Port: 03c0h
  420. usage:      Screen border color
  421. Description: In text modes, the screen border color register
  422.              selects the color of the border that sorrounds the
  423.              text display area on the screen. This is also referred
  424.              to by IBM as overscan. Unfortunately, this feature
  425.              does not work properly on EGA displays in 350-line
  426.              modes.
  427. ------------------------------------------------------------
  428. Port-Index: 12h              Port: 03c0h
  429. usage:      Color plane enable register
  430.             d7,d6 Reserved
  431.             d5,d4 Video status mux
  432.             d3    Enable color plane 3
  433.             d2    Enable color plane 2
  434.             d1    Enable color plane 1
  435.             d0    Enable color plane 0
  436. Description:  The video status mux bits can be used in conjunction
  437.              with the diagnostic bits of input status register 1
  438.              to read palette registers. For the EGA, this is the
  439.              only means available for reading the palette registers.
  440.               Enable color planes can be used to enable or disable
  441.              color planes at the input to the color lockup table.
  442.              A zero in any of these bit positions will mask the
  443.              data from that color plane. The effect on the display
  444.              will be the same as if that color plane were cleared
  445.              to all zeros.
  446. ------------------------------------------------------------
  447. Port-Index: 13h              Port: 03c0h
  448. usage:      Horizontal panning register
  449.             d7-d4 reserved
  450.             d3-d0 Horizontal pan
  451. Description: Horizontal pan allows the display to be shifted
  452.              horizontally one pixel at a time.
  453.  
  454.              d3-d0      Number of pixels shifted to the left
  455.                         0+,1+,2+     13h     Other modes
  456.                         3+,7,7+
  457.              0          1            0       0
  458.              1          2            1       -
  459.              2          3            2       1
  460.              3          4            3       -
  461.              4          5            4       2
  462.              5          6            5       -
  463.              6          7            6       3
  464.              7          8            7       -
  465.              8          9            -       -
  466. ------------------------------------------------------------
  467. Port-Index: 14h              Port: 03c0h
  468. usage:      Color select register
  469.             d7-d4 Reserved
  470.             d3    color 7
  471.             d2    color 6
  472.             d1    color 5
  473.             d0    color 4
  474. Description:  Color 7 and color 6: are normally used as the high
  475.              order bits of the eight-bit video color data from the
  476.              attribute controller to the DACs. The only exceptions
  477.              are 256-color modes
  478.               Color 5 and color 4: can be used in place of the p5
  479.              and p6 outputs from the palette registers (see mode
  480.              control register - index 10h). In 16-color modes, the
  481.              color select register can be used to rapidly cycle
  482.              between sets of colors in the video DAC.
  483. ------------------------------------------------------------
  484. Port-Index: -                Port: 03c6h
  485. usage:      Pixel mask register
  486. Description: ???
  487. ------------------------------------------------------------
  488. Port-Index: -                Port: 03c7h
  489. usage:      DAC state register (read-only)
  490. Description: if d0 and d1 is set to zero it indicates that
  491.              the lookup table is in a write mode
  492. ------------------------------------------------------------
  493. Port-Index: -                Port: 03c7h
  494. usage:      Lookup table read index register (Write only)
  495. Description: Used when you want to read the palette (set color
  496.              number)
  497. ------------------------------------------------------------
  498. Port-Index: -                Port: 03c8h
  499. usage:      Lookup table write index register
  500. Description: Used when you want to change palette (set color
  501.              number)
  502. ------------------------------------------------------------
  503. Port-Index: -                Port: 03c9h
  504. usage:      Lookup table data register
  505. Description: Read color value (Red-Green-Blue) or write same data.
  506. =========================================================================
  507. = Shaggy member of The Yellow Ones                                      =
  508. =                                                                       =
  509. = E-Mail: D91-SJD@TEKN.HJ.SE               -------------------          =
  510. =                                          - Beaty is in the -          =
  511. = Snail-Mail: Daniel Sjoberg               - beholders eyes  -          =
  512. =             Mogatan 11                   -                 -          =
  513. =             S-56634 HABO                 -       Charta 77 -          =
  514. =             SWEDEN                       -------------------          =
  515. =========================================================================
  516.  
  517.  
  518.